//
//  MaterialCollectionViewCell.m
//  HandWork
//
//  Created by 王阳阳 on 16/1/20.
//  Copyright © 2016年 www.lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "MaterialCollectionViewCell.h"

@implementation MaterialCollectionViewCell
-(void)dealloc
{
    [_bgimg release];
    [_titlelabel release];
    [super dealloc];
}
#pragma mark - 初始化
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self creatlay];
    }
    return self;
}
- (void)creatlay
{
    //图片
    self.bgimg = [[UIImageView alloc]init];
    [self.contentView addSubview:self.bgimg];
    [_bgimg release];
    //标题
    self.titlelabel = [[UILabel alloc]init];
    [self.contentView addSubview:self.titlelabel];
    [_titlelabel release];
}
#pragma mark - 布局
- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
    [super applyLayoutAttributes:layoutAttributes];
    //图片
    self.bgimg.frame = CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width / 2 - 30, 150);
    //标题
    self.titlelabel.frame =CGRectMake(0, self.contentView.frame.size.height - 60, [UIScreen mainScreen].bounds.size.width / 2 - 30, 60);
    self.titlelabel.numberOfLines = 0;//不限行数
    self.titlelabel.font = [UIFont systemFontOfSize:12.0];//字体大小
}

@end
